﻿<%@ Page Title="" Language="C#"  MasterPageFile="~/Views/Share/Index.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <script src="../../Scripts/common/jquery.leanModal.min.js" type="text/javascript"></script>
        <style type="text/css">
        #lean_overlay { position: fixed; z-index: 100; top: 0px; left: 0px; height: 100%; width: 100%; background: #000; display: none; }
        #OpenWindow { font-size:12px; background: none repeat scroll 0 0 #FFFFFF; border-radius: 5px 5px 5px 5px; box-shadow: 0 0 4px rgba(0, 0, 0, 0.7); display: none; padding-bottom: 2px; width: 300px; z-index: 11000; left: 50%; margin-left: -202px; opacity: 1; position: fixed; top: 200px;}
        #OpenWindow-header { background: url("../../img/hd-bg.png") repeat scroll 0 0 transparent; border-bottom: 1px solid #eeeeee; border-top-left-radius: 5px; border-top-right-radius: 5px; padding: 10px; }
        #OpenWindow-header h2{margin-left:10px;}
        .modal_close { background: url("../../img/modal_close.png") repeat scroll 0 0 transparent; display: block; height: 14px; position: absolute; right: 12px; top: 12px; width: 14px; z-index: 2; }
 
        #OpenWindow .txt-fld { border-bottom: 1px solid #EEEEEE; padding: 8px 6px; position: relative; text-align: left; width: 244px;cursor:pointer;}
        #OpenWindow .txt-fld label { padding-left: 15px;color:Black;}
        </style>
<script type="text/javascript" language="JavaScript">
    var LibraryBook = { lb_id: 0,  lb_bookName: "", lb_translatedName: "", lb_language: 0, lb_ebook: 0,
        lb_forAge: 0, lb_level: 0, lb_bookType: 0, lb_bookTheme: 0,
        lb_author: "", lb_press: "", lb_time: new Date(), lb_pageSize: 0, lb_kb: 0, lb_paper: "", lb_bz: "", lb_price: 0, lb_aboutEbook: "", lb_aboutCd: 0,
        lb_aboutMp3: "", lb_bookContent: "", lb_bookPreview: "", lb_cover: "", lb_position: "", lb_inventory: 0
    };
    var mylist, booklanguage = [], bookforAge = [], bookebook = [], boollevel = [], bookTheme = [], bookType = [], bookState = [], bookaboutcd=[];
    var regular_input = {
        lb_bookName: { exp: /^.{1,100}$/, m: "请输入书名，50字符以内" },
        lb_language: { exp: /^[0-9]\d*$/, m: "请选择语种" },
        lb_ebook: { exp: /^[0-9]\d*$/, m: "请选择电子书或图书" },
        lb_forAge: { exp: /^[0-9]\d*$/, m: "请选择适读年龄" },
        lb_level: { exp: /^[0-9]\d*$/, m: "请选择级别" },
        lb_bookType: { exp: /^[0-9]\d*$/, m: "请选择图书类型" },
        lb_bookTheme: { exp: /^[0-9]\d*$/, m: "请选择主题" },
        lb_time: { exp: /^.{1,20}$/, m: "请输入时间" },
        lb_price: { exp: /^\d+(\.\d+)?$/, m: "请输入正确的价格" },
        lb_aboutCd: { exp: /^[0-9]\d*$/, m: "请选择相关CD" }
    }
    var mainForm = "";
    $(document).ready(function () {
        mylist = new TurnPage("mylist");
        mylist.pageSize = 8;
        mylist.callback = function () { ajax(); };
        function ajax() {
            var ajaxparam = getpara();
            $.post("/LibraryBook/getLibraryBookist.html?" + (new Date()).getTime(), ajaxparam, function (data) {
                data = $.evalJSON(data);
                if (mylist.currPage == 1) {
                    mylist.total = $.grep(data, function (n, i) { return typeof (n.total) == "number"; })[0].total;
                    data = $.grep(data, function (n, i) { return typeof (n.total) == "undefined"; });
                }
                loadDta(data);
            });
        }
        $("#outExcel").click(function () {
            var ajaxparam = getpara();
            var _param = "/librarybook/booklistExce.html?bookName=" + ajaxparam.bookName + "&translatedName=" + ajaxparam.translatedName + "&language=" + ajaxparam.language + "&ebook=" + ajaxparam.ebook + "&forAge=" + ajaxparam.forAge + "&level=" + ajaxparam.level + "&bookType=" + ajaxparam.bookType + "&bookTheme=" + ajaxparam.bookTheme + "&author=" + ajaxparam.author + "&press=" + ajaxparam.press + "&state=" + ajaxparam.state + "&in_s=" + ajaxparam.in_s + "&in_e=" + ajaxparam.in_e + "&isbn=" + ajaxparam.isbn + "&selbookaboutcd=" + ajaxparam.selbookaboutcd + "&txtbookcount=" + ajaxparam.txtbookcount + "&txtbooksum=" + ajaxparam.txtbooksum + "&txtbsum=" + ajaxparam.txtbsum + "&txtwhere=" + ajaxparam.txtwhere + "&txtjiage=" + ajaxparam.txtjiage + "&olb_bookName=" + ajaxparam.olb_bookName + "&olb_ebook=" + ajaxparam.olb_ebook + "&olb_forAge=" + ajaxparam.olb_forAge + "&olb_level=" + ajaxparam.olb_level + "&olb_bookType=" + ajaxparam.olb_bookType + "&olb_bookTheme=" + ajaxparam.olb_bookTheme + "&olb_booksCount=" + ajaxparam.olb_booksCount + "&olb_inventory=" + ajaxparam.olb_inventory + "&olb_position=" + ajaxparam.olb_position + "&olb_price=" + ajaxparam.olb_price + "&olb_state=" + ajaxparam.olb_state + "&olb_id=" + ajaxparam.olb_id;
            window.location.href = _param;
        });
        var loadDta = function (list) {
            var sp = [];
            var mapid;
            $("#mainTable tbody[name=mainlist]").html("");
            $.each(list, function (i, n) {
                sp.push('<tr>');
                sp.push('<td>' + n.lb_bookName + '</td>');
                sp.push('<td>' + n.lb_translatedName + '</td>');
                sp.push('<td>' + bookebook["x" + n.lb_ebook] + '</td>');
                sp.push('<td>' + bookforAge["x" + n.lb_forAge] + '</td>');
                sp.push('<td>' + boollevel["x" + n.lb_level] + '</td>');
                sp.push('<td>' + bookType["x" + n.lb_bookType] + '</td>');
                sp.push('<td>' + bookTheme["x" + n.lb_bookTheme] + '</td>');
                sp.push('<td>' + n.lb_booksCount + '</td>');
                sp.push('<td>' + n.lb_inventory + '</td>');
                sp.push('<td>' + n.lb_position + '</td>');
                sp.push('<td>' + n.lb_price + '</td>');  //
                sp.push('<td>' + bookState["x" + n.lb_state] + '</td>');
                sp.push('<td>')
                sp.push('<a href="#mainForm" onclick="edit(' + n.lb_id + ')" name="linkEdit" vid="' + n.lb_id + '">修改</a><br>');
                sp.push('<a href="#OpenWindow" rel="leanModal" onclick="xjBook(' + n.lb_id + ')" name="linkDel" >状态修改</a><br>')
                sp.push("<a href='#' onclick=\"opendialog('" + encodeURI(n.lb_bookName) + "','" + n.lb_id + "')\">ISBN管理</a>")
                sp.push('</td>');
                sp.push('</tr>');
            });
            $("#mainTable tbody[name=mainlist]").append(sp.join(''));
            //if (sp.length == 0) alert('没有符合条件的数据');
            $("#pager").html(mylist.getOutput());
            $('a[rel*=leanModal]').leanModal({ top: 100, closeButton: ".modal_close" });
        }
        ajax();
        $("input[name=buttSeek]").click(function () {
            mylist.currPage = 1;
            ajax();
        });
        $("input[name=buttsend]").click(function () {
            if (!$.checkFormValid("mainForm")) return false;
            $.fillObj(LibraryBook, "#mainForm");
            LibraryBook.lb_aboutEbook = $('#lb_aboutEbook').attr('filepath');
            LibraryBook.lb_aboutMp3 = $('#lb_aboutMp3').attr('filepath');
            LibraryBook.lb_cover = $('#lb_cover').attr('filepath');
            LibraryBook.lb_bookContent = tinyMCE.get('lb_bookContent').getContent();
            LibraryBook.lb_bookPreview = tinyMCE.get('lb_bookPreview').getContent();
            if (!/^\d$/.test(LibraryBook.lb_pageSize)) {
                LibraryBook.lb_pageSize = 0;
            }

            if (LibraryBook.lb_bookContent == '') {
                alert("请输入内容简介"); return false;
            }
            if (LibraryBook.lb_bookPreview == '') {
                alert("请输入图书预览"); return false;
            }
            if (LibraryBook.lb_cover == undefined) {
                alert("请上传图片封面"); return false;
            }
            $.post("/LibraryBook/saveLibraryBook.html", { LibraryBook: $.toJSON(LibraryBook) }, function (dta) {
                alert("保存成功");
                $("#btnreset").click();
                ajax();
            });
        });
        $("#btnreset").click(function () {
            $("#mainForm input").each(function () {
                if ($(this).attr("id") != "buttsend" && $(this).attr("id") != "btnreset" && $(this).attr("id") != "lb_time") {
                    $(this).val("");
                }
            });
            $("#mainForm select").each(function () {
                $(this).val("");
            });
            $("#lb_bookPreview_ifr").contents().find("#tinymce").html("");
            $("#lb_bookContent_ifr").contents().find("#tinymce").html("");
        });
        $("#btnSetCard").click(function () {
            if ($("#opeselState").val() == "-1") {
                alert("请选择书籍状态");
                return false;
            }
            if (confirm("确定要修改图书状态?")) {
                $.post("/LibraryBook/xjBook.html?" + (new Date()).getTime(), { res: $(this).attr("idd"), state: $("#opeselState").val() }, function (dta) {
                    alert("书籍状态保存成功");
                    $(".modal_close").click();
                    $("input[name='buttSeek']").click();
                });
            }
        });
    });

    function opendialog(bookname, lbid) {
        var a = window.showModalDialog("/librarybook/booklist.html?" + (new Date()).getTime() + "&bookname=" + bookname + "&lbid=" + lbid, "", "dialogWidth:1000px;");
        if (a == 1) {
            $("input[name='buttSeek']").click();
        }
    }
    function edit(id) {
        $.post("/LibraryBook/getLibraryBookbyid.html?" + (new Date()).getTime(), { res: id }, function (dta) {
            LibraryBook = $.evalJSON(dta);
            $.fillForm(LibraryBook, "#mainForm");
            $("#lb_bookPreview_ifr").contents().find("#tinymce").html(LibraryBook.lb_bookPreview);
            $("#lb_bookContent_ifr").contents().find("#tinymce").html(LibraryBook.lb_bookContent);
            $('#lb_cover').attr('filepath', LibraryBook.lb_cover);
            $("input[name=buttsend]").val('修改');
        });
    }
    function del(id) {
        if (confirm("确定删除?")) {
            $.post("/LibraryBook/deleteLibraryBook.html?" + (new Date()).getTime(), { res: id }, function (dta) {
                $("input[name='buttSeek']").click();
            });
        }
    }

    function xjBook(id) {
        $("#btnSetCard").attr("idd", id);
    }
 
    function getpara() {
        var bookName = $.trim($("#seekForm :input[name=txtbookName]").val());
        var translatedName = $.trim($("#seekForm :input[name=txttranslatedName]").val());
        var language = $.trim($("#seekForm :input[name=sellanguage]").val());
        var ebook = $.trim($("#seekForm :input[name=selebook]").val());
        var forAge = $.trim($("#seekForm :input[name=selforAge]").val());
        var level = $.trim($("#seekForm :input[name=sellevel]").val());
        var bookType = $.trim($("#seekForm :input[name=selbookType]").val());
        var bookTheme = $.trim($("#seekForm :input[name=selbookTheme]").val());
        var author = $.trim($("#seekForm :input[name=txtauthor]").val());
        var press = $.trim($("#seekForm :input[name=txtpress]").val());
        var in_s = $.trim($("#seekForm :input[name=txtin_s]").val());
        var in_e = $.trim($("#seekForm :input[name=txtin_e]").val());
        var state = $.trim($("#seekForm :input[name=selState]").val());
        var isbn = $.trim($("#seekForm :input[name=txtisbn]").val());
        var selbookaboutcd = $.trim($("#seekForm :input[name=selbookaboutcd]").val());
        var txtbookcount = $.trim($("#seekForm :input[name=txtbookcount]").val());
        var txtbooksum = $.trim($("#seekForm :input[name=txtbooksum]").val());
        var txtbsum = $.trim($("#seekForm :input[name=txtbsum]").val());
        var txtwhere = $.trim($("#seekForm :input[name=txtwhere]").val());
        var txtjiage = $.trim($("#seekForm :input[name=txtjiage]").val());
        var olb_bookName = $("#seekForm :input[name=olb_bookName]").attr("checked");
        var olb_ebook = $("#seekForm :input[name=olb_ebook]").attr("checked");
        var olb_forAge = $("#seekForm :input[name=olb_forAge]").attr("checked");
        var olb_level = $("#seekForm :input[name=olb_level]").attr("checked");
        var olb_bookType = $("#seekForm :input[name=olb_bookType]").attr("checked");
        var olb_bookTheme = $("#seekForm :input[name=olb_bookTheme]").attr("checked");
        var olb_booksCount = $("#seekForm :input[name=olb_booksCount]").attr("checked");
        var olb_inventory = $("#seekForm :input[name=olb_inventory]").attr("checked");
        var olb_position = $("#seekForm :input[name=olb_position]").attr("checked");
        var olb_price = $("#seekForm :input[name=olb_price]").attr("checked");
        var olb_state = $("#seekForm :input[name=olb_state]").attr("checked");
        var olb_id = $("#seekForm :input[name=olb_id]").attr("checked");

        if (!/^\d{0,5}$/.test(txtbookcount)) {
            alert('图书总量格式不正确');
            $("#seekForm :input[name=txtbookcount]").focus();
            $("#seekForm :input[name=txtbookcount]").select();
            return false;
        }
        if (!/^\d{0,5}$/.test(txtbooksum)) {
            alert('图书库存量格式不正确');
            $("#seekForm :input[name=txtbooksum]").focus();
            $("#seekForm :input[name=txtbooksum]").select();
            return false;
        }
        if (!/^\d{0,5}$/.test(txtbsum)) {
            alert('图书借出量格式不正确');
            $("#seekForm :input[name=txtbsum]").focus();
            $("#seekForm :input[name=txtbsum]").select();
            return false;
        }
        if (!/^\d+(\.\d+)?$/.test(txtjiage) && txtjiage != "") {
            alert('价格格式不正确');
            $("#seekForm :input[name=txtjiage]").focus();
            $("#seekForm :input[name=txtjiage]").select();
            return false;
        }
        var param = { pagesize: mylist.pageSize, pageno: mylist.currPage, bookName: bookName, translatedName: translatedName,
            language: language, ebook: ebook, forAge: forAge, level: level, bookType: bookType, bookTheme: bookTheme, author: author,
            press: press, state: state, in_s: in_s, in_e: in_e, isbn: isbn, selbookaboutcd: selbookaboutcd, txtbookcount: txtbookcount, txtbooksum: txtbooksum, txtbsum: txtbsum, txtwhere: txtwhere, txtjiage: txtjiage, olb_bookName: olb_bookName, olb_ebook: olb_ebook, olb_forAge: olb_forAge, olb_level: olb_level, olb_bookType: olb_bookType, olb_bookTheme: olb_bookTheme, olb_booksCount: olb_booksCount, olb_inventory: olb_inventory, olb_position: olb_position, olb_price: olb_price, olb_state: olb_state, olb_id: olb_id
        };
        return param;
    }
</script>
 <div id="OpenWindow">
        <div id="signup-ct">
            <div id="OpenWindow-header">
                <h2 id="sutitle"></h2>
                <a href="#" class="modal_close"></a>
            </div>
 
            <div class="txt-fld" >
            书籍状态：<select id="opeselState">
                    <option value="-1">请选择</option>
                    <%
                        foreach (string s in Enum.GetNames(typeof(DAL.Enums.bookState)))
                        {
                            int _v = (int)Enum.Parse(typeof(DAL.Enums.bookState), s);
                            Response.Write("<option value='" + _v + "'>" + s + "</option>");
                        }
                    %>
                </select>
             <input type="button" id="btnSetCard" value="保存" />
            </div>
            <div style="height:20px;"></div>
         </div>
</div>
    <table cellspacing="0" id="seekForm">
        <tr>
            <th>
                图书管理
            </th>
        </tr>
        <tr>
        <td>
        ISBN：<input type="text" name="txtisbn" />
        书名：<input type="text" name="txtbookName" />
        译      名：<input type="text" name="txttranslatedName" />
        语种：<select name="sellanguage">
                    <option value="-1">请选择</option>
                    <%
                        foreach (string s in Enum.GetNames(typeof(DAL.Enums.booklanguage)))
                        {
                            int _v = (int)Enum.Parse(typeof(DAL.Enums.booklanguage), s);
                            Response.Write("<option value='" + _v + "'>" + s + "</option>");
                            Response.Write("<script>booklanguage['x" + _v + "']='" + s + "';</script>");
                        }
                    %>
                </select>
                
                 适读年龄：<select name="selforAge">
                    <option value="-1">请选择</option>
                    <%
                        foreach (string s in Enum.GetNames(typeof(DAL.Enums.bookforAge)))
                        {
                            int _v = (int)Enum.Parse(typeof(DAL.Enums.bookforAge), s);
                            Response.Write("<option value='" + _v + "'>" + s.Replace("_","") + "</option>");
                            Response.Write("<script>bookforAge['x" + _v + "']='" + s.Replace("_","") + "';</script>");
                        }
                    %>
                </select><p />
               级别：<select name="sellevel">
                    <option value="-1">请选择</option>
                    <%
                        foreach (string s in Enum.GetNames(typeof(DAL.Enums.boollevel)))
                        {
                            int _v = (int)Enum.Parse(typeof(DAL.Enums.boollevel), s);
                            Response.Write("<option value='" + _v + "'>" + s + "</option>");
                            Response.Write("<script>boollevel['x" + _v + "']='" + s + "';</script>");
                        }
                    %>
                </select>
              类型：<select name="selbookType">
                    <option value="-1">请选择</option>
                    <%
                        foreach (string s in Enum.GetNames(typeof(DAL.Enums.bookType)))
                        {
                            int _v = (int)Enum.Parse(typeof(DAL.Enums.bookType), s);
                            Response.Write("<option value='" + _v + "'>" + s + "</option>");
                            Response.Write("<script>bookType['x" + _v + "']='" + s + "';</script>");
                        }
                    %>
                </select>
              主题：<select name="selbookTheme">
                    <option value="-1">请选择</option>
                    <%
                        foreach (string s in Enum.GetNames(typeof(DAL.Enums.bookTheme)))
                        {
                            int _v = (int)Enum.Parse(typeof(DAL.Enums.bookTheme), s);
                            Response.Write("<option value='" + _v + "'>" + s + "</option>");
                            Response.Write("<script>bookTheme['x" + _v + "']='" + s + "';</script>");
                        }
                    %>
                </select>               
                              是否有CD：<select name="selbookaboutcd">
                    <option value="-1">请选择</option>
                    <%
                        foreach (string s in Enum.GetNames(typeof(DAL.Enums.bookAboutCd)))
                        {
                            int _v = (int)Enum.Parse(typeof(DAL.Enums.bookAboutCd), s);
                            Response.Write("<option value='" + _v + "'>" + s + "</option>");
                            Response.Write("<script>bookaboutcd['x" + _v + "']='" + s + "';</script>");
                        }
                    %>
                </select>
                电子或图书：<select name="selebook">
                    <option value="-1">请选择</option>
                    <%
                        foreach (string s in Enum.GetNames(typeof(DAL.Enums.bookebook)))
                        {
                            int _v = (int)Enum.Parse(typeof(DAL.Enums.bookebook), s);
                            Response.Write("<option value='" + _v + "'>" + s + "</option>");
                            Response.Write("<script>bookebook['x" + _v + "']='" + s + "';</script>");
                        }
                    %>
                </select>
<p />
                作者：<input type="text" name="txtauthor" />
                出版社：<input type="text" name="txtpress" />
                图书总量：<input type="text" name="txtbookcount" />
                图书库存量：<input type="text" name="txtbooksum" />
                <p />图书借出量：<input type="text" name="txtbsum" />

                
                入库时间：<input type="text" size="15" name="txtin_s" value="<%=System.DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd") %>" class="date" />
                至<input type="text" size="15" name="txtin_e" value="<%=System.DateTime.Now.ToString("yyyy-MM-dd") %>" class="date" />
                <script type="text/javascript">
                    $(document).ready(function () {
                        $(function () {
                            $(':text[name=txtin_s]').datepicker({
                                numberOfMonths: 1,
                                showButtonPanel: true, 
                                changeMonth: true,
                                yearRange: '-40:+1',changeYear: true
                            });
                            $(':text[name=txtin_e]').datepicker({
                                numberOfMonths: 1,
                                showButtonPanel: true, 
                                changeMonth: true,
                                yearRange: '-40:+1',changeYear: true
                            });
                        });
                    });
                </script>
                存放地点：<input type="text" name="txtwhere" />
                <p />
                价格：<input type="text" name="txtjiage" />
                               书籍状态：<select name="selState">
                    <option value="-1">请选择</option>
                    <%
                        foreach (string s in Enum.GetNames(typeof(DAL.Enums.bookState)))
                        {
                            int _v = (int)Enum.Parse(typeof(DAL.Enums.bookState), s);
                            Response.Write("<option value='" + _v + "'>" + s + "</option>");
                            Response.Write("<script>bookState['x" + _v + "']='" + s + "';</script>");
                        }
                    %>
                </select>
            <p/>
            排序：<input type="checkbox" name="olb_bookName" />书名<input type="checkbox" name="olb_ebook" />图书形式<input type="checkbox" name="olb_forAge" />适读年龄<input type="checkbox" name="olb_level" />级别<input type="checkbox" name="olb_bookType" />类型<input type="checkbox" name="olb_bookTheme" />主题<input type="checkbox" name="olb_booksCount" />图书总量<input type="checkbox" name="olb_inventory" />库存量<input type="checkbox" name="olb_position" />存放地点<input type="checkbox" name="olb_price" />价格<input type="checkbox" name="olb_state" />书籍状态<input type="checkbox" name="olb_id" checked />入库时间
            <input type="button" name="buttSeek" value="查询" onclick="" class="btn1" />
            <input type="button" id="outExcel" value="导入到Excel" class="btn1" />
        </td>
        </tr>
    </table>
    <table id="mainTable" cellspacing="0">
        <caption style="color: red; font-size: 15px; font-weight: bold">图书列表</caption>
        <tr>
            <th>书名</th>
            <th>译名</th>
            <th>电子或图书</th>
            <th>适读年龄</th>
            <th>级别</th>
            <th>类型</th>
            <th>主题</th>
            <th>总量</th>
            <th>库存量</th>
            <th>存放地点</th>
            <th>价格</th>
            <th>状态</th>
            <th></th>
            </tr>
        <tbody name="mainlist">        
        </tbody>
    </table>
    <div id="pager" class="pager">
    </div>
    <table cellspacing="0" id="mainForm">
        <tr>
            <th colspan="3">
                编辑图书信息
            </th>
        </tr>
        <tr>
            <td>书名*</td>
            <td><input id="lb_bookName" name="lb_bookName" maxlength="50"  /></td>
            <td><span class="tsxx"></span></td>
        </tr>
        <tr>
            <td>译名</td>
            <td><input id="lb_translatedName" name="lb_translatedName" maxlength="50"  /></td>
            <td><span class="tsxx"></span></td>
        </tr>
         <tr>
            <td>语种*</td>
            <td>
            <select name="lb_language">
                    <option value="">请选择</option>
                    <%
                        foreach (string s in Enum.GetNames(typeof(DAL.Enums.booklanguage)))
                        {
                            int _v = (int)Enum.Parse(typeof(DAL.Enums.booklanguage), s);
                            Response.Write("<option value='" + _v + "'>" + s + "</option>");
                        }
                    %>
                </select>
            </td>
            <td><span class="tsxx"></span></td>
        </tr>
        <tr>
            <td><span>电子或图书</span>*</td>
            <td>
            <select name="lb_ebook">
                    <option value="">请选择</option>
                    <%
                        foreach (string s in Enum.GetNames(typeof(DAL.Enums.bookebook)))
                        {
                            int _v = (int)Enum.Parse(typeof(DAL.Enums.bookebook), s);
                            Response.Write("<option value='" + _v + "'>" + s + "</option>");
                        }
                    %>
                </select>
            </td>
            <td><span class="tsxx"></span></td>
        </tr>
        <tr>
            <td><span>适读年龄</span>*</td>
            <td>
            <select name="lb_forAge">
                    <option value="">请选择</option>
                    <%
                        foreach (string s in Enum.GetNames(typeof(DAL.Enums.bookforAge)))
                        {
                            int _v = (int)Enum.Parse(typeof(DAL.Enums.bookforAge), s);
                            Response.Write("<option value='" + _v.ToString() + "'>" + s.Replace("_", "") + "</option>");
                        }
                    %>
                </select>
            </td>
            <td><span class="tsxx"></span></td>
        </tr>
        <tr>
            <td><span>级别</span>*</td>
            <td>
            <select name="lb_level">
                    <option value="">请选择</option>
                    <%
                        foreach (string s in Enum.GetNames(typeof(DAL.Enums.boollevel)))
                        {
                            int _v = (int)Enum.Parse(typeof(DAL.Enums.boollevel), s);
                            Response.Write("<option value='" + _v + "'>" + s + "</option>");
                        }
                    %>
                </select>
            </td>
            <td><span class="tsxx"></span></td>
        </tr>
        <tr>
            <td><span>类型</span>*</td>
            <td>
            <select name="lb_bookType">
                    <option value="">请选择</option>
                    <%
                        foreach (string s in Enum.GetNames(typeof(DAL.Enums.bookType)))
                        {
                            int _v = (int)Enum.Parse(typeof(DAL.Enums.bookType), s);
                            Response.Write("<option value='" + _v + "'>" + s + "</option>");
                        }
                    %>
                </select>
            </td>
            <td><span class="tsxx"></span></td>
        </tr>
        <tr>
            <td><span>主题</span>*</td>
            <td>
            <select name="lb_bookTheme">
                    <option value="">请选择</option>
                    <%
                        foreach (string s in Enum.GetNames(typeof(DAL.Enums.bookTheme)))
                        {
                            int _v = (int)Enum.Parse(typeof(DAL.Enums.bookTheme), s);
                            Response.Write("<option value='" + _v + "'>" + s + "</option>");
                        }
                    %>
                </select>
            </td>
            <td><span class="tsxx"></span></td>
        </tr>
         <tr>
            <td>作者</td>
            <td><input id="lb_author" name="lb_author" maxlength="20"  /></td>
            <td><span class="tsxx"></span></td>
        </tr>
                <tr>
            <td>出版社</td>
            <td><input id="lb_press" name="lb_press" maxlength="10"  /></td>
            <td><span class="tsxx"></span></td>
        </tr>
                <tr>
            <td>出版时间</td>
            <td><input id="lb_time" name="lb_time" value="<%=System.DateTime.Now.ToString("yyyy-MM-dd") %>" maxlength="20"   class="date"  /></td>
            <td><span class="tsxx"></span></td>
        </tr>
             
        <tr>
            <td>页数</td>
            <td><input type="text"  size="15" id="lb_pageSize" name="lb_pageSize" /></td>
            <td><span class="tsxx"></span></td>
        </tr>
         <tr>
            <td><span>开本</span></td>
            <td>
            <select name="lb_kb">
                    <option value="">请选择</option>
                    <%
                        foreach (string s in Enum.GetNames(typeof(DAL.Enums.bookKb)))
                        {
                            int _v = (int)Enum.Parse(typeof(DAL.Enums.bookKb), s);
                            Response.Write("<option value='" + _v + "'>" + s.Replace("_", "") + "</option>");
                        }
                    %>
                </select>
            </td>
            <td><span class="tsxx"></span></td>
        </tr>
        <tr>
            <td>纸张</td>
            <td><input id="lb_paper" name="lb_paper" maxlength="25"  /></td>
            <td><span class="tsxx"></span></td>
        </tr>
        <tr>
            <td>包装</td>
            <td><input id="lb_bz" name="lb_bz" maxlength="10"  /></td>
            <td><span class="tsxx"></span></td>
        </tr>
                <tr>
            <td>价格*</td>
            <td><input id="lb_price" name="lb_price" maxlength="100"  /></td>
            <td><span class="tsxx"></span></td>
        </tr>
         <tr>
            <td>相关电子书 </td>
            <td><% Html.RenderPartial("~/Views/Plugins/jqueryUploadFile.ascx", (ViewData["uploadFileId"] = "lb_aboutEbook"));%></td>
            <td><span class="tsxx"></span></td>
        </tr>
        <tr>
            <td><span>相关CD</span>*</td>
            <td>
            <select name="lb_aboutCd">
                    <option value="">请选择</option>
                    <%
                        foreach (string s in Enum.GetNames(typeof(DAL.Enums.bookAboutCd)))
                        {
                            int _v = (int)Enum.Parse(typeof(DAL.Enums.bookAboutCd), s);
                            Response.Write("<option value='" + _v + "'>" + s.Replace("_", "") + "</option>");
                        }
                    %>
                </select>
            </td>
            <td><span class="tsxx"></span></td>
        </tr>
        <tr>
            <td>相关音频文件 </td>
            <td><% Html.RenderPartial("~/Views/Plugins/jqueryUploadFile.ascx", (ViewData["uploadFileId"] = "lb_aboutMp3"));%></td>
            <td><span class="tsxx"></span></td>
        </tr>
        <tr>
            <td>内容简介</td>
            <td><% Html.RenderPartial("~/Views/Plugins/TinymceAreaText.ascx", (ViewData["tinymceId"] = "lb_bookContent"));%></td>
            <td><span id="msglb_bookContent" class="tsxx"></span></td>
        </tr>
          <tr>
            <td>图书预览</td>
            <td><% Html.RenderPartial("~/Views/Plugins/TinymceAreaText.ascx", (ViewData["tinymceId"] = "lb_bookPreview"));%></td>
            <td><span id="msglb_bookPreview" class="tsxx"></span></td>
        </tr>
        <tr>
            <td>封面 </td>
            <td><% Html.RenderPartial("~/Views/Plugins/jqueryUploadFile.ascx", (ViewData["uploadFileId"] = "lb_cover"));%></td>
            <td><span class="tsxx"></span></td>
        </tr>
        <tr>
            <td>存放位子</td>
            <td><input id="lb_position" name="lb_position" maxlength="20"  /></td>
            <td><span class="tsxx"></span></td>
        </tr>
        <tr class="main-status" id="mainstatus" style="display: none">
            <td colspan="3" class="bbd-bj-bom" align="center" height="41">
                正在验证表单....
            </td>
        </tr>
        <tr class="main-sub" id="mainsub">
            <td colspan="3" class="bbd-bj-bom" align="center" height="41">
                <input type="button" id="buttsend" name="buttsend" class="btn1" style="width: 200px" 
                    value="保存" /><input type="button" id="btnreset" class="btn1" style="width: 200px" value="重置" />
 
            </td>
        </tr>
    </table>

</asp:Content>
